Skip to content

Sheffield | 26-ITP-Jan | Seti Mussa | Sprint 2 | Coursework#1217

Open
Seti-Jemal wants to merge 6 commits intoCodeYourFuture:mainfrom
Seti-Jemal:coursework/sprint-2
Open

Sheffield | 26-ITP-Jan | Seti Mussa | Sprint 2 | Coursework#1217
Seti-Jemal wants to merge 6 commits intoCodeYourFuture:mainfrom
Seti-Jemal:coursework/sprint-2

Conversation

@Seti-Jemal
Copy link

@Seti-Jemal Seti-Jemal commented Mar 7, 2026

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Completed sprint 2

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@Seti-Jemal Seti-Jemal added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module labels Mar 7, 2026
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase

function convertToUpperSnakeCase(str) {
return str.toUpperCase().trim().split("").join("_");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works.

Could also consider using the string's methods .replaceAll() or replace().

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 11, 2026
@Seti-Jemal Seti-Jemal added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 14, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 14, 2026
@github-actions

This comment has been minimized.

@Seti-Jemal Seti-Jemal added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 14, 2026
Comment on lines +8 to +12
const toPounds = (kg) => +(kg * 2.20462).toFixed(2);

const penceToPounds = (p) => `£${(p / 100).toFixed(2)}`;
const toUpperSnakeCase = (s) => s.toUpperCase().trim().split(" ").join("_");
const multiply = (a, b) => a * b;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why implement 4 different functions in this file?

  • The input to the code in Sprint-1 is a "pence string" in the form "399p" (with a trailing 'p'). The function on line 10 would not work properly if the given p is a string in this format. Can you update the function accordingly so that your function can return "£3.99" when the given argument is "399p"?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 14, 2026
@Seti-Jemal Seti-Jemal added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 14, 2026
//
// The penceToPounds function was updated to handle a pence string like "399p".
// It removes the "p", converts the value to a number, and divides by 100
// so the function correctly returns "£3.99".s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried calling penceToPounds("399p") to see if it can successfully return "£3.99"?

// Four functions are implemented because each one performs a specific task.
// This makes the code easier to read, reuse, and maintain.

However, three of the functions are not needed for converting pence string to pound string.
Perhaps you want to keep them in the file they belong to? Or keep them in separate file on your computer (if you want to save them for use later)?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants